Skip to content

ci(release): mint GitHub App installation token instead of RELEASE_TOKEN PAT#494

Open
Nashon-Steffen wants to merge 1 commit intomainfrom
feat/release-app-token
Open

ci(release): mint GitHub App installation token instead of RELEASE_TOKEN PAT#494
Nashon-Steffen wants to merge 1 commit intomainfrom
feat/release-app-token

Conversation

@Nashon-Steffen
Copy link
Copy Markdown

Summary

  • Replace the long-lived RELEASE_TOKEN PAT with a GitHub App installation token minted via actions/create-github-app-token@v3.1.1 in create-release-pr.yml and create-release-tag.yml.
  • Installation tokens are short-lived (1h) and repo-scoped, while still satisfying the constraint that GITHUB_TOKEN cannot trigger downstream workflows (e.g. docker-publish.yml, releaser-helm-chart.yml).

Pre-merge configuration (required)

The release workflows will fail until the following are configured on this repo:

  1. Install the release GitHub App on stacklok/toolhive-cloud-ui with repository permissions:
    • contents: write (for the tag workflow)
    • pull-requests: write (for the release PR workflow)
  2. Set repository variable RELEASE_APP_CLIENT_ID to the app's Client ID.
  3. Set repository secret RELEASE_APP_PRIVATE_KEY to the app's private key (PEM).

Post-merge cleanup

  • Delete the now-unused RELEASE_TOKEN repository secret from repo settings.

Test plan

  • Verify GitHub App is installed on stacklok/toolhive-cloud-ui with required permissions.
  • Verify vars.RELEASE_APP_CLIENT_ID and secrets.RELEASE_APP_PRIVATE_KEY are set on the repo.
  • Trigger Create Release PR (patch bump) once via workflow_dispatch and confirm the PR is opened by the App actor.
  • Merge that release PR and confirm create-release-tag.yml succeeds, the tag is pushed, the GitHub Release is published, and docker-publish.yml + releaser-helm-chart.yml fire.
  • After successful release, delete the RELEASE_TOKEN repo secret.

Refs: stacklok/toolhive#4835

🤖 Generated with Claude Code

…KEN PAT

Replace the long-lived RELEASE_TOKEN PAT with a GitHub App installation
token (via actions/create-github-app-token) for both create-release-pr.yml
and create-release-tag.yml.

The installation token is short-lived (1h), repository-scoped, and avoids
the GITHUB_TOKEN limitation where downstream workflows do not fire.

Refs: stacklok/toolhive#4835

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Nashon Steffen <nashon@stacklok.com>
Copilot AI review requested due to automatic review settings April 28, 2026 17:06
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Apr 28, 2026
Copy link
Copy Markdown
Collaborator

@peppescg peppescg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
skip the grype and pnpm audit I will take care of it in a dedicated pr

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Replaces the long-lived RELEASE_TOKEN PAT used by release automation with a short-lived GitHub App installation token, so release/tag events can still trigger downstream workflows while reducing credential risk.

Changes:

  • Mint a GitHub App installation token via actions/create-github-app-token@v3.1.1 in the release PR workflow and pass it to stacklok/releaseo.
  • Mint and use the same GitHub App token in the release tag workflow for pushing tags and creating GitHub Releases (instead of a PAT).
  • Update inline comments to reflect the new token strategy.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
.github/workflows/create-release-tag.yml Generates a GitHub App token and uses it as GH_TOKEN for tag push + gh release create.
.github/workflows/create-release-pr.yml Generates a GitHub App token and passes it to releaseo for creating the release PR.

Comment on lines 135 to +137
# Create GitHub Release (triggers docker-publish.yml and releaser-helm-chart.yml)
# Note: Must use PAT (GH_TOKEN) because GITHUB_TOKEN cannot trigger other workflows
# Note: Uses a GitHub App installation token rather than GITHUB_TOKEN,
# because events from GITHUB_TOKEN cannot trigger downstream workflows.
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The note here says the GitHub Release triggers downstream workflows, but earlier in this same file the header comment says the tag push triggers docker/helm workflows (via on: push: tags: ["v*"]). These comments contradict the actual setup (release-ui.yml triggers on release: published). Please update the surrounding documentation so it consistently reflects the real trigger path (Release published -> release-ui.yml -> workflow_call jobs).

Copilot uses AI. Check for mistakes.
@Nashon-Steffen Nashon-Steffen enabled auto-merge (squash) April 28, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants